<template>
  <div>
    <CdPageList
      ref="pageListRef"
      class="full-item col-dib"
      url="/api/eqd1000tpm/eqd1000tpm/findListBy1000"
      :search-form="searchForm"
      table-view-no="jy_eqdBasic1000tpm_list_table"
      :allSortable="true"
      fixedHeight="500"
    >
      <template #search>
        <Row>
          <Col span="8">
            <Form-item label="测试" prop="equclacode">
              <!-- <CdCascaderMultiple
                v-model="searchForm.equclacode"
                dict-type="sys_area"
                parent-value="000000"
                :multiple="true"
              /> -->
              <CdCascader
                ref="equclacodeCascader"
                v-model="searchForm.equclacode"
                dict-type="sys_area"
                parent-value="000000"
                @on-change="onChange"
              />
            </Form-item>
          </Col>
          <Col span="8">
            <Form-item label="测试" prop="test1">
              <Input v-model="searchForm.test1" />
            </Form-item>
          </Col>
        </Row>
      </template>

      <template #fold>
        <Row>
          <Col span="8">
            <Form-item label="测试">
              <Input />
            </Form-item>
          </Col>
        </Row>
      </template>
    </CdPageList>

    <!-- <Button type="primary" @click="reset">重置</Button>
    <Button type="primary" @click="showChange('110000')">1级展示变更1</Button>
    <Button type="primary" @click="showChange('120000')">1级展示变更2</Button>
    <Button type="primary" @click="showChange('110100')">2级展示变更1</Button>
    <Button type="primary" @click="showChange('110200')">2级展示变更2</Button>
    <Button type="primary" @click="parentValueChange('110000')">父级值变更1</Button>
    <Button type="primary" @click="parentValueChange('120000')">父级值变更2</Button>
    <Button type="primary" @click="onValidte">校验</Button> -->
  </div>
</template>

<script setup lang="ts">
import CdPageList from '@/components/bussiness/CdPageList/index.vue'
import CdCascaderMultiple from '@/components/basic/CdCascader/cascaderMultiple.vue'
import CdCascader from '@/components/basic/CdCascader/cascader.vue'
import { computed, reactive, ref, type Ref } from 'vue'
defineOptions({ name: 'boiler' })

// import CdSelect from '@/components/basic/CdSelect/select.vue'
// import { ref } from 'vue'
// import { computed } from '@vue/reactivity'
const searchForm = reactive({
  regorgname: '',
  equclacode: '110000',
  test1: ''
})

const showableRootVals: Ref<string[]> = ref(['110000'])
const showableSubVals: Ref<string[]> = ref(['110100'])
const parentValue = ref('000000')
const onChange = (values: string[], labels: string[]) => {
  console.log(values, labels)
}
const reset = () => {
  searchForm.equclacode = ''
}
const showChange = (type: string) => {
  // showableRootVals.value = [type]
  showableSubVals.value = [type]
}

const parentValueChange = (type: string) => {
  parentValue.value = type
}

const equclacodeCascader = ref()
const onValidte = () => {
  if (!equclacodeCascader.value.levSelectJudgeHandle()) return

  console.log('------')
}

const columns = computed(() => {
  return [
    {
      title: 'Name',
      key: 'name'
    },
    {
      title: 'Age',
      key: 'age'
    },
    {
      title: 'Address',
      key: 'address'
    }
  ]
})

const pageListRef = ref()
const onQueryAble = () => {
  pageListRef.value.tableOptions.canQuery = false
}
</script>

<style scoped></style>
